import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { DashboardOutlined } from '@vicons/antd';
import { renderIcon } from '@/utils/index';

const routeName = 'MoniterCenter';

/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param meta 路由元信息（路由附带扩展信息）
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 * */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/MoniterCenter',
    name: routeName,
    redirect: '/MoniterCenter/userList',
    component: Layout,
    meta: {
      title: '监控中心',
      icon: renderIcon(DashboardOutlined),
      sort: 3,
    },
    children: [
      {
        path: '/MoniterCenter/query/real-time-moniter',
        name: 'MoniterCenterRealTimeMoniter',
        component: () => import('@/views/MoniterCenter/query/real-time-moniter/Lists.vue'),
        meta: { title: '实时监控', keepAlive: true, permission: ['form'] },
      },
      {
        path: '/MoniterCenter/query/alram-record',
        name: 'MoniterCenterAlarmRecord',
        component: () => import('@/views/MoniterCenter/query/alarm-record/Lists.vue'),
        meta: { title: '报警记录', keepAlive: true, permission: ['form'] },
      },
      {
        path: '/MoniterCenter/query/real-time-video',
        name: 'MoniterCenterRealTimeVideo',
        component: () => import('@/views/MoniterCenter/query/real-time-moniter/Lists.vue'),
        meta: { title: '实时视频', keepAlive: true, permission: ['form'] },
      },
      {
        path: '/MoniterCenter/query/history-line',
        name: 'MoniterCenterHistoryLine',
        component: () => import('@/views/MoniterCenter/query/history-line/Lists.vue'),
        meta: { title: '历史轨迹', keepAlive: true, permission: ['form'] },
      },
      {
        path: '/MoniterCenter/video/replay',
        name: 'MoniterCenterVideoReplay',
        component: () => import('@/views/MoniterCenter/query/video/Replay.vue'),
        meta: { title: '视频回放', keepAlive: true, permission: ['form'] },
      },
    ],
  },
];

export default routes;
